#ifndef __UDK_DEFAULT_DEF_H__
#define __UDK_DEFAULT_DEF_H__

#include "sdk_ifs_udk_cfg.h"
#include "udf_def.h"


/*
UDKv3系统配置，用户不可修改*/

#ifdef UDF13_AT_BB_SRAM
#define UDF13_AT_BB_SRAM_ADDR (BBE_ABUF0_BASE+10*1024)
#endif

#if IS_RAMAPP == 1
#if !defined(UDF13_AT_BB_SRAM)
#error IS_RAMAPP==1 must define(UDF13_AT_BB_SRAM)@udk_user_def.h
#endif
#if UDF_EN != (1<<4|1<<12)
#error IS_RAMAPP==1 must 'have and only' (UDF05+UDF13)
#endif
#elif IS_RAMAPP > 1
#if UDF_EN != (1<<4)
#error IS_RAMAPP>1 must 'have and only' (UDF05)
#endif
#endif

#if 1 /* LOG配置 */

#ifndef LOG_ENABLE
#define LOG_ENABLE
#endif

#if !defined(LOG_LEVEL)
#define LOG_LEVEL (LOG_LEVEL_EMERG)
#endif

#define LOG_LEVEL_DEBUG   (7)
#define LOG_LEVEL_INFO    (6)
#define LOG_LEVEL_NOTICE  (5)
#define LOG_LEVEL_WARNING (3)
#define LOG_LEVEL_ERROR   (1)
#define LOG_LEVEL_EMERG   (0)

#ifdef LOG_ENABLE

#ifndef LOG_INTERFACE
#define LOG_INTERFACE                (0) // 0 uart  1 spi
#endif

#if LOG_INTERFACE == 1
#define LOG_SEND_STRING(lvl,str) if( lvl <= LOG_LEVEL ){udsf_ft232_send_string(str);}
#define LOG_SEND_U32_BASE16(lvl,a,b,c,d,e) if( lvl <= LOG_LEVEL ){udsf_ft232_send_u32_base16(a,b,c,d,e);}
#define LOG_SEND_U16_BASE16(lvl,a,b,c,d,e) if( lvl <= LOG_LEVEL ){udsf_ft232_send_u16_base16(a,b,c,d,e);}
#define LOG_SEND_U8_BASE16(lvl,a,b,c,d) if( lvl <= LOG_LEVEL ){udsf_ft232_send_u8_base16(a,b,c,d);}
#else
#define LOG_SEND_STRING(lvl,str); if( lvl <= LOG_LEVEL ){udsf_uart_send_string(str);}
#define LOG_SEND_U32_BASE16(lvl,a,b,c,d,e); if( lvl <= LOG_LEVEL ){udsf_uart_send_u32_base16(a,b,c,d,e);}
#define LOG_SEND_U16_BASE16(lvl,a,b,c,d,e); if( lvl <= LOG_LEVEL ){udsf_uart_send_u16_base16(a,b,c,d,e);}
#define LOG_SEND_U8_BASE16(lvl,a,b,c,d); if( lvl <= LOG_LEVEL ){udsf_uart_send_u8_base16(a,b,c,d);}
#endif
#else 
#define LOG_SEND_STRING(lvl,str) 
#define LOG_SEND_U32_BASE16(lvl,a,b,c,d,e)
#define LOG_SEND_U16_BASE16(lvl,a,b,c,d,e)
#define LOG_SEND_U8_BASE16(lvl,a,b,c,d)
#endif

#endif

#endif
